//
//  AppDelegate.m
//  应用程序对象
//
//  Created by 伍银荣 on 2021/6/20.
//  Copyright © 2021 com.example. All rights reserved.
//

#import "AppDelegate.h"
#import "SecondViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

/**
 只有在当前程序中将这个应用程序滑出后才会执行应用销毁的方法,如果此时已经进入后台了然后再滑出程序的话,是不会执行应用销毁的方法的
 **/


//视图控制器加载完成
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSLog(@"---视图控制器加载完成---");
    _window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    SecondViewController *secVC = [[SecondViewController alloc]init];
   // secVC.view.backgroundColor = [UIColor redColor];
    
    _window.rootViewController = secVC;
    
    [_window makeKeyAndVisible];
    return YES;
}


//即将进入不活跃状态(失去焦点)
- (void)applicationWillResignActive:(UIApplication *)application {
    NSLog(@"即将进入不活跃状态(失去焦点)");
}



//应用已经进入后台
- (void)applicationDidEnterBackground:(UIApplication *)application {
    NSLog(@"应用已经进入后台");
}

//即将进入前台
- (void)applicationWillEnterForeground:(UIApplication *)application {
    NSLog(@"即将进入前台");
}

//应用变为活跃状态
- (void)applicationDidBecomeActive:(UIApplication *)application {
    NSLog(@"应用变为活跃状态");
}

//应用销毁
- (void)applicationWillTerminate:(UIApplication *)application {
    NSLog(@"应用销毁");
}


@end
